package cn.zjk.springframework.beans.factory.support;

import cn.zjk.springframework.beans.BeansException;
import cn.zjk.springframework.core.io.DefaultResourceLoader;
import cn.zjk.springframework.core.io.Resource;
import cn.zjk.springframework.core.io.ResourceLoader;

/**
 * @author zjk
 * @CreateTime 2023/3/24 15:50
 */

public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader{

    private final BeanDefinitionRegister register;

    private ResourceLoader resourceLoader;

    protected AbstractBeanDefinitionReader(BeanDefinitionRegister register){
        this(register,new DefaultResourceLoader());
    }

    public AbstractBeanDefinitionReader(BeanDefinitionRegister register, ResourceLoader resourceLoader) {
        this.register = register;
        this.resourceLoader = resourceLoader;
    }

    @Override
    public BeanDefinitionRegister getRegistry() {
        return register;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }
}
